﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
//using PowerCreator.LMS.Logic.Common;
//using PowerCreator.LMS.Logic.PaperManager;

public partial class sysadmin_CountManager_FCQuestionPass : System.Web.UI.Page
{
    //ManagerPaperUserAnswer objPaperUserAnswerLogic = new ManagerPaperUserAnswer();

    //3D饼图
    const string VIEW_START = "<graph showNames='1'  decimalPrecision='0' baseFontSize='14'>";
    const string VIEW_DATA_TD = "<set name='{0}' value='{1}' />";
    const string VIEW_END = "</graph>";
    const string VIEW_URL = "/FusionCharts/FCF_Pie3D.swf";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //string qid = Base64.Decode(Request.QueryString["q"].ToString());


            //string url = Utils.WebRoot + VIEW_URL;
            //string xml = GetXMLPie3D(int.Parse(qid));
            //if (!string.IsNullOrEmpty(xml))
            //{
            //    Literal1.Text = InfoSoftGlobal.FusionCharts.RenderChartHTML(url, "", xml, "myxml", "800", "400", false);
            //}
            //else
            //{
            //    Literal1.Text = "<br/ >目前没有该试题的统计信息!";
            //}
        }
    }

    private string GetXMLPie3D(int questionID)
    {
        StringBuilder sbXml = new StringBuilder();
        //DataTable dt = new DataTable();
        //string search = " and qf.QuestionID=" + questionID.ToString();
        //dt = objPaperUserAnswerLogic.QuestionCountList(search, 1, 1);
        //int PassCount = int.Parse(dt.Rows[0]["RightCount"].ToString());
        //int UserSumCount = int.Parse(dt.Rows[0]["Usercount"].ToString());
        //int UnPassCount = UserSumCount - PassCount;
               
        //sbXml.Append(string.Format(VIEW_START));
        //sbXml.Append(string.Format(VIEW_DATA_TD, "正确人数", PassCount.ToString()));
        //sbXml.Append(string.Format(VIEW_DATA_TD, "错误人数", UnPassCount.ToString()));
        //sbXml.Append(VIEW_END);

        //if (PassCount ==0& UnPassCount == 0)
        //{
        //    sbXml.Remove(0, sbXml.Length);
        //}
        return sbXml.ToString();
    }
}
